package day1602;

import java.util.*;

public class kkk {
    public static void main(String[] args) {
        HashMap<Integer,String> a = new HashMap<>();
        String[] b ={"a","b","c","d","e","f","g","h","i","j","k","l","m","n"};
        for(int i =0;i<new Random().nextInt(50);i++){
            String st = "";
            for(int j=0;j<new Random().nextInt(8)+2;j++){
                st=st+b[new Random().nextInt(b.length)];
            }
            a.put(i,st);
        }
//        Set<Integer> c = a.keySet();//通过增强for循环
//        for(Integer in:c){
//            System.out.println(a.get(in));
//        }

//        Set<Integer> c = a.keySet();//通过迭代器调用
//        Iterator d =  c.iterator();
//        while (d.hasNext()){
//            System.out.println(a.get(d.next()));
//        }
        Set<Map.Entry<Integer,String>> c =  a.entrySet();
        for(Map.Entry ww : c){
            System.out.println(ww.getKey());
            System.out.println(ww.getValue());
        }

    }
}
